import 'package:flutter/material.dart';

class Button extends StatefulWidget {
  final text;
  final size;
  final Function onClick;
  final radius;

  Button({
    Key key,
    this.text,
    this.size,
    this.onClick,
    this.radius,
  }) : super(key: key);

  _ButtonState createState() => _ButtonState();
}

class _ButtonState extends State<Button> {
  @override
  Widget build(BuildContext context) {
    return FlatButton(
        shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(
                this.widget.radius != null ? this.widget.radius : 10.0)),
        color: Color(0xFF20A0FF),
        disabledColor: Color(0xFFCCCCCC),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            this.widget.size == 'lg'
                ? Padding(
                    padding: EdgeInsets.all(12.0),
                    child: Text(
                      this.widget.text,
                      style: TextStyle(
                        color: Colors.white,
                        fontSize: 16.0,
                      ),
                    ),
                  )
                : Text(
                    this.widget.text,
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 16.0,
                    ),
                  ),
          ],
        ),
        onPressed: this.widget.onClick);
  }
}
